var scrollObj;
var generatedCount = 0;

function loaded () {
	scrollObj = new MyScroll('#wrapper', {
    pullUpEl: "#pullUp",
    pullUpAction: requestNewData 
  });
}

function requestNewData() {
  setTimeout(function () {  // <-- Simulate network congestion, remove setTimeout from production!
    var el, li, i;
    el = document.getElementById('newslist');

    for (i=0; i<3; i++) {
    li = document.createElement('div');
    li.innerHTML = '<div class="news-list-item"><div class="left"><img src="images/jly1.jpg" /></div><div class="right"><div class="right-top"><p>金龙鱼助力中国美食登顶纽约联合国总部</p></div><div class="right-bottom flex-pack-justify"><p class="news-channel">时事频道</p><p class="news-time">2017-8-9 10:32:11</p><p class="clearboth" /></div></div>';
    el.appendChild(li, el.childNodes[0]);
    }
    scrollObj.refresh();
  }, 1000); // <-- Simulate network congestion, remove setTimeout from production!    
}
